package com.wzdigit.wms.basic.mapper.core.order;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.basic.client.response.task.AsnQtyCheck;
import com.wzdigit.wms.basic.domain.asn.AsnHeader;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 收货通知单信息 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-01-12
 */
@MyBatisRepository
public interface AsnHeaderMapper extends BaseMapper<AsnHeader> {


    void updateStatusById(@Param("asnHeaderId") Integer asnHeaderId,
                          @Param("status")   int status,
                          @Param("userName")    String userName);
    
    int updateStatusBySsnNoAndAsnTypeAndStatus(
    		@Param("status") Integer status, @Param("asnNo") String asnNo, 
    		@Param("asnType") String asnType, @Param("byStatus") Integer byStatus);

    List<AsnQtyCheck> selectQty(@Param("status")   int status,@Param("asnType") String asnType);

    List<BigDecimal> selectCheckHeaderId(@Param("statusList") List<Integer> statusList,@Param("asnType") String asnType);

    void updateStatusByIdNew(@Param("asnHeaderIds") List<BigDecimal> asnHeaderIds,
                             @Param("status")   int status,
                             @Param("userName")    String userName);

    void updateDtlStatusByIdNew(@Param("asnHeaderIds") List<BigDecimal> asnHeaderIds,
                             @Param("status")   int status,
                             @Param("userName")    String userName);


    AsnHeader searchRecieveHeader(@Param("mfgLine") String mfgLine,@Param("skuId") Integer skuId,
                                  @Param("prdWo") String prdWo,@Param("closeTime") Date closeTime,
                                  @Param("status") Integer status,@Param("asnType") String asnType);

    List<BigDecimal> searchCloseHeaderId(@Param("asnTypeList") List<String> asnTypeList,
                                         @Param("closeTime") Date closeTime);
}
